<%@ page contentType="text/html; charset=utf-8" %>

<%@ include file="/WEB-INF/jsp/includeTop.jsp" %>
<%@ include file="/WEB-INF/jsp/includeTaglib.jsp" %>

<form:form commandName="defaultTemplateForm" id="editDefaultTemplateForm" method="post">
<input type="hidden" name="updatekey" value="${defaultTemplate.id}">
<input type="hidden" id="smsorvoicekey" name="smsorvoicekey" value="">
<table width="100%" border="0" cellpadding="0" cellspacing="5">
  <tr>
    <td valign="top">
      <table class="dbborder" width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="bottom" class="blueTableBg">&nbsp;默认模板管理&nbsp;-&nbsp;编辑默认模板</td>
        </tr>
        <tr>
          <td>
            <table width="100%" border="0" cellpadding="0" cellspacing="5">
              <tr>
                <td>
                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td class="dashTopLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashTop" width=100%><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashTopRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>

                    <div class="globalTextBold">模板描述：
                    	<input type="text" id="descriptionTxt" class="txtbox" size="20" name="descriptionTxt" value="${defaultTemplate.description}"/>
                    </div><p/>

                    <tr>
                      <td class="dashLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td align="center">
                        <table width="100%" border="0" cellpadding="0" cellspacing="3">
                          <tr>
                            <td width="10%" height="20" class="globalText">短信方式设定：</td>
                            <td colspan="9">&nbsp;</td>
                          </tr>
                          <tr>
                            <td width="5%" height="20" class="globalText">节点：</td>
                            <td width="10%" height="20" class="globalText">
															<form:select path="msgNodeSlt" >
								              	<form:options items="${defaultTemplateForm.nodeOpts}" itemValue="key" itemLabel="value" />
								             	</form:select>
                            </td>
                            <td width="5%" height="20" class="globalText">产品类型：</td>
                            <td width="10%" height="20" class="globalText">
															<form:select path="msgProductTypeSlt" >
								              	<form:option value="">--全部--</form:option>
								              	<form:options items="${defaultTemplateForm.productTypeOpts}" itemValue="key" itemLabel="value" />
								             	</form:select>
                            </td>
                            <td width="5%" height="20" class="globalText">条件：</td>
                            <td width="10%" height="20" class="globalText">
															<form:select path="msgConditionTypeSlt" >
								              	<form:option value="">--全部--</form:option>
								              	<form:options items="${defaultTemplateForm.conditionTypeOpts}" itemValue="key" itemLabel="value" />
								             	</form:select>
                            </td>
                            <td width="5%" height="20" class="globalText">条件值：</td>
                            <td width="10%" height="20" class="globalText">
															<form:select path="msgConditionSlt" >
								              	<form:option value="">--全部--</form:option>
								              	<form:options items="${defaultTemplateForm.conditionOpts}" itemValue="key" itemLabel="value" />
								             	</form:select>
                            </td>
                            <td width="20%">&nbsp;</td>
                            <td width="20%">&nbsp;</td>
                          </tr>
                          <tr>
                            <td width="10%" height="20" class="globalText">通信启用：</td>
                            <td width="5%" height="20" class="globalText">
                            	<select id="msgEnabledSlt" name="msgEnabledSlt">
                            	  <option value="1">是</option>
                            	  <option value="0">否</option>
                            	</select>
                            </td>
                            <td width="10%" height="20" class="globalText">短信模板编号：</td>
                            <td width="18%" height="20" class="globalText">
                            	<input type="text" id="messageTemplateIdTxt" class="txtbox" size="15" name="messageTemplateIdTxt" />&nbsp;
                            	<a id="quickViewMsgTemplate" href="quickViewMsgTemplate.html" rel="quickViewMsgTemplate.html" title="选取短信模板">选取</a>
                            </td>
                            
                            <td width="10%" height="20" class="globalText">通信规则编号：</td>
                            <td width="18%" height="20" class="globalText">
                            	<input type="text" id="msgRuleTemplateIdTxt" class="txtbox" size="15" name="msgRuleTemplateIdTxt" />&nbsp;
                            	<a id="quickViewMsgRuleTemplate" href="quickViewMsgRuleTemplate.html" rel="quickViewMsgRuleTemplate.html" title="选取通信规则">选取</a>
                            </td>
                            <td width="10%" height="20" class="globalText">通信时间编号：</td>
                            <td width="19%" height="20" class="globalText">
                            	<input type="text" id="msgTimeTemplateIdTxt" class="txtbox" size="15" name="msgTimeTemplateIdTxt"  />
                            	<a id="quickViewMsgTimeTemplate" href="quickViewMsgTimeTemplate.html" rel="quickViewMsgTimeTemplate.html" title="选取通信时间">选取</a>
                            </td>
                          </tr>
                        </table>
                      </td>
                      <td class="dashRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashBottomLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashBottom" width=100%><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashBottomRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr>
                <td>
                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td class="dashTopLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashTop" width=100%><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashTopRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td align="center">
                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                          <tr>
                            <td>
                              <table border="0" cellpadding="0" cellspacing="2">
                                <tr>
                                  <td><c:if test="${!empty smsMappings}">
                                  <input type="button" id="previewSMSBtn" class="btnStyle" value=" 预览 " >
                                  </c:if></td>
                                  <td><input type="button" id="saveSMSBtn" class="btnStyle" value=" 添加  "></td>
                                  <td><c:if test="${!empty smsMappings}">
	                                  <input type="button" class="btnStyle" value=" 删除  " onclick="javascript:doDelete1('cbSmsIds', 'deleteSmsKeys', 'formDeleteSms')" >
                                  </c:if></td>
                                  <td><input type="button" id="cancelSMSBtn" class="btnStyle" value="  取消  "></td>
                                </tr>
                              </table>
                            </td>
                          </tr>
           	<%@ include file="/WEB-INF/jsp/defaulttemplate/smsTemplateMappingList.jsp" %>
													
                        </table>
                      </td>
                      <td class="dashRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashBottomLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashBottom" width=100%><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashBottomRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr>
                <td>
                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td class="dashTopLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashTop" width=100%><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashTopRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td align="center">
                        <table width="100%" border="0" cellpadding="0" cellspacing="3">
                          <tr>
                            <td height="20" class="globalText" colspan="8">
                            	<textarea id="smsPreview" name="smsPreview" rows="5" cols="120" readonly="readonly"></textarea>                   	
                            </td>
                          </tr>
                        </table>
                      </td>
                      <td class="dashRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashBottomLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashBottom" width=100%><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashBottomRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr>
                <td>
                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td class="dashTopLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashTop" width=100%><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashTopRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td align="center">
                        <table width="100%" border="0" cellpadding="0" cellspacing="3">
                          <tr>
                            <td width="10%" height="20" class="globalText">语音方式设定：</td>
                            <td colspan="9">&nbsp;</td>
                          </tr>
                          <tr>
                            <td width="5%" height="20" class="globalText">节点：</td>
                            <td width="10%" height="20" class="globalText">
															<form:select path="voiceNodeSlt" >
								              	<form:options items="${defaultTemplateForm.nodeOpts}" itemValue="key" itemLabel="value" />
								             	</form:select>
                            </td>
                            <td width="5%" height="20" class="globalText">产品类型：</td>
                            <td width="10%" height="20" class="globalText">
															<form:select path="voiceProductTypeSlt" >
								              	<form:option value="">--全部--</form:option>
								              	<form:options items="${defaultTemplateForm.productTypeOpts}" itemValue="key" itemLabel="value" />
								             	</form:select>
                            </td>
                            <td width="5%" height="20" class="globalText">条件：</td>
                            <td width="10%" height="20" class="globalText">
															<form:select path="voiceConditionTypeSlt" >
								              	<form:option value="">--全部--</form:option>
								              	<form:options items="${defaultTemplateForm.conditionTypeOpts}" itemValue="key" itemLabel="value" />
								             	</form:select>
                            </td>
                            <td width="5%" height="20" class="globalText">条件值：</td>
                            <td width="10%" height="20" class="globalText">
															<form:select path="voiceConditionSlt" >
								              	<form:option value="">--全部--</form:option>
								              	<form:options items="${defaultTemplateForm.conditionOpts}" itemValue="key" itemLabel="value" />
								             	</form:select>
                            </td>
                            <td width="20%">&nbsp;</td>
                            <td width="20%">&nbsp;</td>
                          </tr>
                          <tr>
                            <td width="10%" height="20" class="globalText">通信启用：</td>
                            <td width="5%" height="20" class="globalText">
                            	<select id="voiceEnabledSlt" name="voiceEnabledSlt">
                            	  <option value="1">是</option>
                            	  <option value="0">否</option>
                            	</select>
                            </td>
                            <td width="10%" height="20" class="globalText">语音模板编号：</td>
                            <td width="18%" height="20" class="globalText">
                            	<input type="text" id="voiceTemplateIdTxt" class="txtbox" size="15" name="voiceTemplateIdTxt"  />&nbsp;
                            	<a id="quickViewVoiceTemplate" href="quickViewVoiceTemplate.html" rel="quickViewVoiceTemplate.html" title="选取语音模板">选取</a>
                            </td>
                            
                            <td width="10%" height="20" class="globalText">通信规则编号：</td>
                            <td width="18%" height="20" class="globalText">
                            	<input type="text" id="voiceRuleTemplateIdTxt" class="txtbox" size="15" name="voiceRuleTemplateIdTxt"  />&nbsp;
                            	<a id="quickViewVoiceRuleTemplate" href="quickViewVoiceRuleTemplate.html" rel="quickViewVoiceRuleTemplate.html" title="选取通信规则">选取</a>
                            </td>
                            <td width="10%" height="20" class="globalText">通信时间编号：</td>
                            <td width="19%" height="20" class="globalText">
                            	<input type="text" id="voiceTimeTemplateIdTxt" class="txtbox" size="15" name="voiceTimeTemplateIdTxt"  />
                            	<a id="quickViewVoiceTimeTemplate" href="quickViewVoiceTimeTemplate.html" rel="quickViewVoiceTimeTemplate.html" title="选取通信时间">选取</a>
                            </td>
                          </tr>
                        </table>
                      </td>
                      <td class="dashRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashBottomLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashBottom" width=100%><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashBottomRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr>
                <td>
                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td class="dashTopLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashTop" width=100%><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashTopRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td align="center">
                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                          <tr>
                            <td>
                              <table border="0" cellpadding="0" cellspacing="2">
                                <tr>
                                  <td><c:if test="${!empty voiceMappings}">
                                  <input type="button" id="previewVoiceBtn" class="btnStyle" value=" 预览 " >
                                  </c:if></td>
                                  <td><input type="button" id="saveVoiceBtn" class="btnStyle" value=" 添加  "></td>
                                  <td><c:if test="${!empty voiceMappings}">
	                                  <input type="button" class="btnStyle" value=" 删除  " onclick="javascript:doDelete1('cbVoiceIds', 'deleteVoiceKeys', 'formDeleteVoice')" >
                                  </c:if></td>
                                  <td><input type="button" id="cancelVoiceBtn" class="btnStyle" value="  取消  "></td>
                                </tr>
                              </table>
                            </td>
                          </tr>                        
           	<%@ include file="/WEB-INF/jsp/defaulttemplate/voiceTemplateMappingList.jsp" %>													
                        </table>
                      </td>
                      <td class="dashRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashBottomLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashBottom" width=100%><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashBottomRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr>
                <td>
                  <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                      <td class="dashTopLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashTop" width=100%><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashTopRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td align="center">
                        <table width="100%" border="0" cellpadding="0" cellspacing="3">
                          <tr>
                            <td height="20" class="globalText" colspan="10">
                            	<textarea id="voicePreview" name="voicePreview" rows="5" cols="120" readonly="readonly"></textarea>                   	
                            </td>
                          </tr>
                        </table>
                      </td>
                      <td class="dashRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>
                    <tr>
                      <td class="dashBottomLeft"><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashBottom" width=100%><img src="images/spacer.gif" width="7" height="7"></td>
                      <td class="dashBottomRight"><img src="images/spacer.gif" width="7" height="7"></td>
                    </tr>
                  </table>
                </td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</form:form>

<form id="formDeleteSms" method="post" action="<c:url value="removeSMSMapping.html?updatekey=${defaultTemplate.id}"/>">
	<input type="hidden" id="deleteSmsKeys" name="deleteSmsKeys">
</form>
<form id="formDeleteVoice" method="post" action="<c:url value="removeVoiceMapping.html?updatekey=${defaultTemplate.id}"/>">
	<input type="hidden" id="deleteVoiceKeys" name="deleteVoiceKeys">
</form>

<script type="text/javascript">	
	$(document).ready(function() {
		//查看可供选择的预览用运单
		/*$("#quickViewPreviewOrder").cluetip({
			width:'500', activation: 'click', sticky: true, closePosition: 'title', closeText:'关闭', arrows: true, mouseOutClose: false, positionBy:'mouse',leftOffset:5,ajaxProcess: function(data) {return data;}
    });*/
	    
		//查看可供选择的短信模板
		$("#quickViewMsgTemplate").cluetip({
			width:'500', activation: 'click', sticky: true, closePosition: 'title', closeText:'关闭', arrows: true, mouseOutClose: false, positionBy:'mouse',leftOffset:5,ajaxProcess: function(data) {return data;}
    });
	    
		//查看可供选择的语音模板
		$("#quickViewVoiceTemplate").cluetip({
			width:'500', activation: 'click', sticky: true, closePosition: 'title', closeText:'关闭', arrows: true, mouseOutClose: false, positionBy:'mouse',leftOffset:5,ajaxProcess: function(data) {return data;}
    });
	    
		//查看可供选择的短信通信规则模板
		$("#quickViewMsgRuleTemplate").cluetip({
			width:'500', activation: 'click', sticky: true, closePosition: 'title', closeText:'关闭', arrows: true, mouseOutClose: false, positionBy:'mouse',leftOffset:5,ajaxProcess: function(data) {return data;}
    });
	    
		//查看可供选择的语音通信规则模板
		$("#quickViewVoiceRuleTemplate").cluetip({
			width:'500', activation: 'click', sticky: true, closePosition: 'title', closeText:'关闭', arrows: true, mouseOutClose: false, positionBy:'mouse',leftOffset:5,ajaxProcess: function(data) {return data;}
    });
	    
		//查看可供选择的短信通信时间模板
		$("#quickViewMsgTimeTemplate").cluetip({
			width:'500', activation: 'click', sticky: true, closePosition: 'title', closeText:'关闭', arrows: true, mouseOutClose: false, positionBy:'mouse',leftOffset:5,ajaxProcess: function(data) {return data;}
    });
	    
		//查看可供选择的语音通信时间模板
		$("#quickViewVoiceTimeTemplate").cluetip({
			width:'500', activation: 'click', sticky: true, closePosition: 'title', closeText:'关闭', arrows: true, mouseOutClose: false, positionBy:'mouse',leftOffset:5,ajaxProcess: function(data) {return data;}
    });

	  //保存
		$("#saveSMSBtn").click(function() {
			$("#smsorvoicekey").val("sms");
		  var descriptionTxt = document.getElementById("descriptionTxt").value.trim();
			if (validateEmpty(descriptionTxt)) {
				alert("模板描述 不能为空");
				return;
			}
			  
		  //短信方式
		  var msgConditionTypeSlt = $("#msgConditionTypeSlt").val().trim();
		  var msgConditionSlt = $("#msgConditionSlt").val().trim();
		  var messageTemplateIdTxt = $("#messageTemplateIdTxt").val().trim();
		  var msgTimeTemplateIdTxt = $("#msgTimeTemplateIdTxt").val().trim();
			
			if (!validateEmpty(msgConditionTypeSlt) && validateEmpty(msgConditionSlt)) {
				alert("短信方式添加，设定条件则必须设定短信条件值");
				return;
			}
		  
			if (validateEmpty(messageTemplateIdTxt)) {
				alert("短信方式添加，需选取短信模板编号");
				return;
			}
	    
			document.getElementById("editDefaultTemplateForm").action = "<c:url value='editDefaultTemplate.html' />";
			document.getElementById("editDefaultTemplateForm").submit();
		});
		
		$("#saveVoiceBtn").click(function() {
			$("#smsorvoicekey").val("voice");
			
			  var descriptionTxt = document.getElementById("descriptionTxt").value.trim();
				if (validateEmpty(descriptionTxt)) {
					alert("模板描述 不能为空");
					return;
				}
			  
			  //语音方式
			  var voiceConditionTypeSlt = $("#voiceConditionTypeSlt").val().trim();
			  var voiceConditionSlt = $("#voiceConditionSlt").val().trim();
			  var voiceTemplateIdTxt = $("#voiceTemplateIdTxt").val().trim();
			  var voiceTimeTemplateIdTxt = $("#voiceTimeTemplateIdTxt").val().trim();

				if (!validateEmpty(voiceConditionTypeSlt) && validateEmpty(voiceConditionSlt)) {
					alert("语音方式添加，设定条件则必须设定条件值");
					return;
				}
			  
				if (validateEmpty(voiceTemplateIdTxt)) {
					alert("语音方式添加，需选取语音模板编号");
					return;
				}
		    
				document.getElementById("editDefaultTemplateForm").action = "<c:url value='editDefaultTemplate.html' />";
				document.getElementById("editDefaultTemplateForm").submit();
			});

	  //放弃
		$("#cancelSMSBtn").click(function() {
			document.getElementById("editDefaultTemplateForm").action = "<c:url value='defaultTemplateMain.html' />";	
			document.getElementById("editDefaultTemplateForm").submit();
		});
		
		$("#cancelVoiceBtn").click(function() {
			document.getElementById("editDefaultTemplateForm").action = "<c:url value='defaultTemplateMain.html' />";	
			document.getElementById("editDefaultTemplateForm").submit();
		});

	  //预览
		$("#previewSMSBtn").click(function() {
		  //var previewOrderIdTxt = $("#previewOrderIdTxt").val().trim();
		  
			if(document.getElementsByName("cbSmsIds") == null){
				return;
			}
			
			if(!checkAtLeastOne1("cbSmsIds")){
				alert("请至少选择一条记录进行预览");
				return;
			}
			
			if(!checkOnlyOne1("cbSmsIds")){
				alert("请只选择一条记录进行预览");
				return;
			}
		  
		  //短信方式
		  var smsMappingId;
			if (document.getElementsByName("cbSmsIds").length == 1){
				smsMappingId = document.getElementsByName("cbSmsIds")[0].value;
			} else {
				for(var i=0;i<document.getElementsByName("cbSmsIds").length;i++){
					if(document.getElementsByName("cbSmsIds")[i].checked){
						smsMappingId = document.getElementsByName("cbSmsIds")[i].value;
						break;
					}
				}
			}
			
     	$.post("<c:url value='previewSMSTemplateMapping.html' />", {smsMappingId:smsMappingId},
     	  function(data){       	  
					$("#smsPreview").html(data);
       	});
		});
		
		$("#previewVoiceBtn").click(function() {
			  //var previewOrderIdTxt = $("#previewOrderIdTxt").val().trim();
		  
			if(document.getElementsByName("cbVoiceIds") == null){
				return;
			}
			
			if(!checkAtLeastOne1("cbVoiceIds")){
				alert("请至少选择一条记录进行预览");
				return;
			}
			
			if(!checkOnlyOne1("cbVoiceIds")){
				alert("请只选择一条记录进行预览");
				return;
			}
			  
			  //语音方式
		  var voiceMappingId;
			if (document.getElementsByName("cbVoiceIds").length == 1){
				voiceMappingId = document.getElementsByName("cbVoiceIds")[0].value;
			} else {
				for(var i=0;i<document.getElementsByName("cbVoiceIds").length;i++){
					if(document.getElementsByName("cbVoiceIds")[i].checked){
						voiceMappingId = document.getElementsByName("cbVoiceIds")[i].value;
						break;
					}
				}
			}
				
     	$.post("<c:url value='previewVoiceTemplateMapping.html' />", {voiceMappingId:voiceMappingId},
     	  function(data){
					$("#voicePreview").html(data);
       	});
			});
	});
</script>